﻿Public Module Skin

  Private Function GetSkinImageFile(ByVal fn As String) As Bitmap
    If IO.File.Exists(SkinPath & "\" & fn) Then
      Return New Bitmap(SkinPath & "\" & fn)
    ElseIf IO.File.Exists(SkinDefaultPath & "\" & fn) Then
      ErrorLog.WriteToErrorLog("BITMNAP NOT FOUND IN CUSTOM SKIN :: " & SkinPath & "\" & fn)
      Return New Bitmap(SkinDefaultPath & "\" & fn)
    Else
      Static badBmp As Bitmap = Nothing ' Nice orange/blue checkerboard to indicate missing bmp
      If badBmp Is Nothing Then
        badBmp = New Bitmap(60, 60)
        Using g As Graphics = Graphics.FromImage(badBmp)
          Dim br As New SolidBrush(Color.OrangeRed)
          Dim bb As New SolidBrush(Color.Blue)
          For x As Integer = 0 To 5
            For y As Integer = 0 To 5
              If (x + y) Mod 2 = 0 Then
                g.FillRectangle(br, x * 12, y * 12, 12, 12)
              Else
                g.FillRectangle(bb, x * 12, y * 12, 12, 12)
              End If
            Next
          Next
        End Using
      End If
      ErrorLog.WriteToErrorLog("BITMAP NOT FOUND IN DEFAULT OR CUSTOM SKIN:: " & SkinPath & "\" & fn)

      Return New Bitmap(badBmp)
    End If
  End Function

#Region " Bottom Row "
  Public ReadOnly Property SkinBitmapBottomRow_DB() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("BottomRow_DB.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapBottomRow_Music() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("BottomRow_Music.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapBottomRow_Playlist() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("BottomRow_Playlist.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapBottomRow_Podcast() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("BottomRow_Podcast.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapBottomRow_Radio() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("BottomRow_Radio.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapBottomRow_Settings() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("BottomRow_Settings.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapBottomRowHL_DB() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("BottomRowHL_DB.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapBottomRowHL_Music() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("BottomRowHL_Music.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapBottomRowHL_Playlist() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("BottomRowHL_Playlist.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapBottomRowHL_Podcast() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("BottomRowHL_Podcast.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapBottomRowHL_Radio() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("BottomRowHL_Radio.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapBottomRowHL_Settings() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("BottomRowHL_Settings.png")
      Return bmp
    End Get
  End Property

#End Region

#Region " Floating Icons "
  Public ReadOnly Property SkinBitmapFloatingIcon_DB() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("FloatingIcon_DB.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapFloatingIcon_Music() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("FloatingIcon_Music.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapFloatingIcon_Playlist() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("FloatingIcon_Playlist.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapFloatingIcon_Podcast() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("FloatingIcon_Podcast.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapFloatingIcon_Radio() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("FloatingIcon_Radio.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapFloatingIcon_Settings() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("FloatingIcon_Settings.png")
      Return bmp
    End Get
  End Property

#End Region

#Region " Top Label "
  Public ReadOnly Property SkinBitmapTopLabel_Background() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("TopLabel_Background.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapTopLabel_MemorizedIcon() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("MemorizedIcon.png")
      Return bmp
    End Get
  End Property
#End Region

#Region " Status Bar "
  Public ReadOnly Property SkinBitmapStatusBar_Top() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("StatusBar_Top.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapStatusBar_Bottom() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("StatusBar_Bottom.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapStatusBarHighlight_Top() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("StatusBarHighlight_Top.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapStatusBarHighlight_Bottom() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("StatusBarHighlight_Bottom.png")
      Return bmp
    End Get
  End Property
#End Region

#Region " Buttons "

#Region " Stop "
  Public ReadOnly Property SkinBitmapButton_StopNormal() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_Stop_Normal.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapButton_StopDown() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_Stop_Down.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapButton_StopInactive() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_Stop_Inactive.png")
      Return bmp
    End Get
  End Property
#End Region
#Region " Play "
  Public ReadOnly Property SkinBitmapButton_PlayNormal() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_Play_Normal.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapButton_PlayDown() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_Play_Down.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapButton_PlayInactive() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_Play_Inactive.png")
      Return bmp
    End Get
  End Property
#End Region
#Region " Pause "
  Public ReadOnly Property SkinBitmapButton_PauseNormal() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_Pause_Normal.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapButton_PauseDown() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_Pause_Down.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapButton_PauseInactive() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_Pause_Inactive.png")
      Return bmp
    End Get
  End Property
#End Region
#Region " Forward "
  Public ReadOnly Property SkinBitmapButton_ForwardNormal() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_Fwd_Normal.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapButton_ForwardDown() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_Fwd_Down.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapButton_ForwardInactive() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_Fwd_Inactive.png")
      Return bmp
    End Get
  End Property
#End Region
#Region " Rewind "
  Public ReadOnly Property SkinBitmapButton_RewindNormal() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_Rew_Normal.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapButton_RewindDown() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_Rew_Down.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapButton_RewindInactive() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_Rew_Inactive.png")
      Return bmp
    End Get
  End Property
#End Region
#Region " Skip Ahead "
  Public ReadOnly Property SkinBitmapButton_SkipAheadNormal() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_SkipAhead_Normal.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapButton_SkipAheadDown() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_SkipAhead_Down.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapButton_SkipAheadInactive() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_SkipAhead_Inactive.png")
      Return bmp
    End Get
  End Property
#End Region
#Region " Skip Back "
  Public ReadOnly Property SkinBitmapButton_SkipBackNormal() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_SkipBack_Normal.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapButton_SkipBackDown() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_SkipBack_Down.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapButton_SkipBackInactive() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_SkipBack_Inactive.png")
      Return bmp
    End Get
  End Property
#End Region
#Region " Memorize "
  Public ReadOnly Property SkinBitmapButton_MemorizeNormal() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_Memorize_Normal.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapButton_MemorizeDown() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_Memorize_Down.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapButton_MemorizeInactive() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_Memorize_Inactive.png")
      Return bmp
    End Get
  End Property
#End Region
#Region " Volume Toggle "
  Public ReadOnly Property SkinBitmapButton_VolumeToggleNormal() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_VolumeToggle_Normal.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapButton_VolumeToggleDown() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_VolumeToggle_Down.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapButton_VolumeToggleInactive() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_VolumeToggle_Inactive.png")
      Return bmp
    End Get
  End Property
#End Region
#Region " Track Slider "
  Public ReadOnly Property SkinBitmapButton_TrackSlider_Empty() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("TrackSlider_Empty.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapButton_TrackSlider_Full() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("TrackSlider_Full.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapButton_TrackSlider_Thumb() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("TrackSlider_Thumb.png")
      Return bmp
    End Get
  End Property
#End Region
#Region " Jump To (Open) Playlist Entry "
  Public ReadOnly Property SkinBitmapButton_JumpToEntryNormal() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_JumpToEntry_Normal.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapButton_JumpToEntryDown() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_JumpToEntry_Down.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapButton_JumpToEntryInactive() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_JumpToEntry_Inactive.png")
      Return bmp
    End Get
  End Property
#End Region
#Region " Volume Form (Big Control) "
  Public ReadOnly Property VolumeForm_BitmapEmpty() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Volume_Empty.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property VolumeForm_BitmapFull() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Volume_Full.png")
      Return bmp
    End Get
  End Property

#End Region
#Region " Previous Scene "
  Public ReadOnly Property SkinBitmapButton_PreviousSceneNormal() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_PrevScene_Normal.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapButton_PreviousSceneDown() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_PrevScene_Down.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapButton_PreviousSceneInactive() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_PrevScene_Inactive.png")
      Return bmp
    End Get
  End Property
#End Region
#Region " Next Scene "
  Public ReadOnly Property SkinBitmapButton_NextSceneNormal() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_NextScene_Normal.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapButton_NextSceneDown() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_NextScene_Down.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapButton_NextSceneInactive() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_NextScene_Inactive.png")
      Return bmp
    End Get
  End Property
#End Region
#Region " Open Audio File "
  Public ReadOnly Property SkinBitmapButton_OpenAudioNormal() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_OpenAudio_Normal.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapButton_OpenAudioDown() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_OpenAudio_Down.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapButton_OpenAudioInactive() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_OpenAudio_Inactive.png")
      Return bmp
    End Get
  End Property
#End Region
#Region " Open Playlist File "
  Public ReadOnly Property SkinBitmapButton_OpenPlaylistNormal() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_OpenPlaylist_Normal.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapButton_OpenPlaylistDown() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_OpenPlaylist_Down.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapButton_OpenPlaylistInactive() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_OpenPlaylist_Inactive.png")
      Return bmp
    End Get
  End Property
#End Region
#Region " Open URL File "
  Public ReadOnly Property SkinBitmapButton_OpenURLNormal() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_OpenURL_Normal.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapButton_OpenURLDown() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_OpenURL_Down.png")
      Return bmp
    End Get
  End Property

  Public ReadOnly Property SkinBitmapButton_OpenURLInactive() As Bitmap
    Get
      Static bmp As Bitmap = GetSkinImageFile("Button_OpenURL_Inactive.png")
      Return bmp
    End Get
  End Property
#End Region

#End Region

#Region " Colors "
  Private iniSettingsFile As Ini.File = Nothing
  Private Sub ReloadSkinINIFile()
    iniSettingsFile = New Ini.File(SkinPath & "\skin.ini")
  End Sub

  Private Function ParseColors(ByVal str As String) As Color
    Try
      If str Is Nothing Then
        Return Color.Black
      End If

      Dim digits() As String = str.Split(",")

      ' We need three color digits
      If digits.Count <> 3 Then
        Return Color.Black
      End If

      Dim red As Integer = Integer.Parse(digits(0))
      Dim green As Integer = Integer.Parse(digits(1))
      Dim blue As Integer = Integer.Parse(digits(2))

      If red > 255 Then red = 255
      If green > 255 Then green = 255
      If blue > 255 Then blue = 255
      If red < 0 Then red = 0
      If green < 0 Then green = 0
      If blue < 0 Then blue = 0

      Return Color.FromArgb(red, green, blue)
    Catch ex As Exception
      ' if any parsing fails, return black
      Return Color.Black
    End Try
  End Function

  Public ReadOnly Property ListTextColorPrimary() As Color
    Get
      Static c As Color? = Nothing
      If c Is Nothing Then
        If iniSettingsFile Is Nothing Then ReloadSkinINIFile()
        With iniSettingsFile.SectionNoNull("Lists")
          Return ParseColors(.StringValue("TextColorPrimary"))
        End With
      End If
      Return c.Value
    End Get
  End Property

  Public ReadOnly Property ListTextColorSecondary() As Color
    Get
      Static c As Color? = Nothing
      If c Is Nothing Then
        If iniSettingsFile Is Nothing Then ReloadSkinINIFile()
        With iniSettingsFile.SectionNoNull("Lists")
          Return ParseColors(.StringValue("TextColorSecondary"))
        End With
      End If
      Return c.Value
    End Get
  End Property

  Public ReadOnly Property ListTextColorHighlight() As Color
    Get
      Static c As Color? = Nothing
      If c Is Nothing Then
        If iniSettingsFile Is Nothing Then ReloadSkinINIFile()
        With iniSettingsFile.SectionNoNull("Lists")
          Return ParseColors(.StringValue("TextColorHighlight"))
        End With
      End If
      Return c.Value
    End Get
  End Property

  Public ReadOnly Property ListTextColorActive() As Color
    Get
      Static c As Color? = Nothing
      If c Is Nothing Then
        If iniSettingsFile Is Nothing Then ReloadSkinINIFile()
        With iniSettingsFile.SectionNoNull("Lists")
          Return ParseColors(.StringValue("TextColorActive"))
        End With
      End If
      Return c.Value
    End Get
  End Property

  Public ReadOnly Property ListTextColorSelected() As Color
    Get
      Static c As Color? = Nothing
      If c Is Nothing Then
        If iniSettingsFile Is Nothing Then ReloadSkinINIFile()
        With iniSettingsFile.SectionNoNull("Lists")
          Return ParseColors(.StringValue("TextColorSelected"))
        End With
      End If
      Return c.Value
    End Get
  End Property

  Public ReadOnly Property ListKeypadNavigationFrame() As Color
    Get
      Static c As Color? = Nothing
      If c Is Nothing Then
        If iniSettingsFile Is Nothing Then ReloadSkinINIFile()
        With iniSettingsFile.SectionNoNull("Lists")
          Return ParseColors(.StringValue("KeypadNavigationFrame"))
        End With
      End If
      Return c.Value
    End Get
  End Property

  Public ReadOnly Property ListBackgroundColor() As Color
    Get
      Static c As Color? = Nothing
      If c Is Nothing Then
        If iniSettingsFile Is Nothing Then ReloadSkinINIFile()
        With iniSettingsFile.SectionNoNull("Lists")
          Return ParseColors(.StringValue("BackgroundColor"))
        End With
      End If
      Return c.Value
    End Get
  End Property

  Public ReadOnly Property ListBackgroundColorAlternate() As Color
    Get
      Static c As Color? = Nothing
      If c Is Nothing Then
        If iniSettingsFile Is Nothing Then ReloadSkinINIFile()
        With iniSettingsFile.SectionNoNull("Lists")
          Return ParseColors(.StringValue("BackgroundColorAlternate"))
        End With
      End If
      Return c.Value
    End Get
  End Property

  Public ReadOnly Property ListBackgroundColorEmpty() As Color
    Get
      Static c As Color? = Nothing
      If c Is Nothing Then
        If iniSettingsFile Is Nothing Then ReloadSkinINIFile()
        With iniSettingsFile.SectionNoNull("Lists")
          Return ParseColors(.StringValue("BackgroundColorEmpty"))
        End With
      End If
      Return c.Value
    End Get
  End Property

  Public ReadOnly Property ListBackgroundColorSelected() As Color
    Get
      Static c As Color? = Nothing
      If c Is Nothing Then
        If iniSettingsFile Is Nothing Then ReloadSkinINIFile()
        With iniSettingsFile.SectionNoNull("Lists")
          Return ParseColors(.StringValue("BackgroundColorSelected"))
        End With
      End If
      Return c.Value
    End Get
  End Property

  Public ReadOnly Property ListScrollBarBackgroundColor() As Color
    Get
      Static c As Color? = Nothing
      If c Is Nothing Then
        If iniSettingsFile Is Nothing Then ReloadSkinINIFile()
        With iniSettingsFile.SectionNoNull("Lists")
          Return ParseColors(.StringValue("ScrollBarBackgroundColor"))
        End With
      End If
      Return c.Value
    End Get
  End Property

  Public ReadOnly Property ListScrollBarBackgroundHighlightColor() As Color
    Get
      Static c As Color? = Nothing
      If c Is Nothing Then
        If iniSettingsFile Is Nothing Then ReloadSkinINIFile()
        With iniSettingsFile.SectionNoNull("Lists")
          Return ParseColors(.StringValue("ScrollBarBackgroundHighlightColor"))
        End With
      End If
      Return c.Value
    End Get
  End Property

  Public ReadOnly Property ListScrollBarForegroundColor() As Color
    Get
      Static c As Color? = Nothing
      If c Is Nothing Then
        If iniSettingsFile Is Nothing Then ReloadSkinINIFile()
        With iniSettingsFile.SectionNoNull("Lists")
          Return ParseColors(.StringValue("ScrollBarForegroundColor"))
        End With
      End If
      Return c.Value
    End Get
  End Property

  Public ReadOnly Property ListScrollBarForegroundHighlightColor() As Color
    Get
      Static c As Color? = Nothing
      If c Is Nothing Then
        If iniSettingsFile Is Nothing Then ReloadSkinINIFile()
        With iniSettingsFile.SectionNoNull("Lists")
          Return ParseColors(.StringValue("ScrollBarForegroundHighlightColor"))
        End With
      End If
      Return c.Value
    End Get
  End Property

  Public ReadOnly Property FormBackgroundColor() As Color
    Get
      Static c As Color? = Nothing
      If c Is Nothing Then
        If iniSettingsFile Is Nothing Then ReloadSkinINIFile()
        With iniSettingsFile.SectionNoNull("Form")
          Return ParseColors(.StringValue("BackgroundColor"))
        End With
      End If
      Return c.Value
    End Get
  End Property

  Public ReadOnly Property FormBackgroundColorTextBox() As Color
    Get
      Static c As Color? = Nothing
      If c Is Nothing Then
        If iniSettingsFile Is Nothing Then ReloadSkinINIFile()
        With iniSettingsFile.SectionNoNull("Form")
          Return ParseColors(.StringValue("BackgroundColorTextBox"))
        End With
      End If
      Return c.Value
    End Get
  End Property

  Public ReadOnly Property FormForegroundInactiveColor() As Color
    Get
      Static c As Color? = Nothing
      If c Is Nothing Then
        If iniSettingsFile Is Nothing Then ReloadSkinINIFile()
        With iniSettingsFile.SectionNoNull("Form")
          Return ParseColors(.StringValue("ForegroundInactiveColor"))
        End With
      End If
      Return c.Value
    End Get
  End Property

  Public ReadOnly Property FormForegroundColor() As Color
    Get
      Static c As Color? = Nothing
      If c Is Nothing Then
        If iniSettingsFile Is Nothing Then ReloadSkinINIFile()
        With iniSettingsFile.SectionNoNull("Form")
          Return ParseColors(.StringValue("ForegroundColor"))
        End With
      End If
      Return c.Value
    End Get
  End Property

  Public ReadOnly Property TrackInfoMainTextColor() As Color
    Get
      Static c As Color? = Nothing
      If c Is Nothing Then
        If iniSettingsFile Is Nothing Then ReloadSkinINIFile()
        With iniSettingsFile.SectionNoNull("TrackInfo")
          Return ParseColors(.StringValue("MainTextColor"))
        End With
      End If
      Return c.Value
    End Get
  End Property

  Public ReadOnly Property TrackInfoOverlayTextColor() As Color
    Get
      Static c As Color? = Nothing
      If c Is Nothing Then
        If iniSettingsFile Is Nothing Then ReloadSkinINIFile()
        With iniSettingsFile.SectionNoNull("TrackInfo")
          Return ParseColors(.StringValue("OverlayTextColor"))
        End With
      End If
      Return c.Value
    End Get
  End Property

  Public ReadOnly Property TrackInfoLargeTimerTextColor() As Color
    Get
      Static c As Color? = Nothing
      If c Is Nothing Then
        If iniSettingsFile Is Nothing Then ReloadSkinINIFile()
        With iniSettingsFile.SectionNoNull("TrackInfo")
          Return ParseColors(.StringValue("LargeTimerTextColor"))
        End With
      End If
      Return c.Value
    End Get
  End Property

  Public ReadOnly Property TrackInfoStatusStripTextColor() As Color
    Get
      Static c As Color? = Nothing
      If c Is Nothing Then
        If iniSettingsFile Is Nothing Then ReloadSkinINIFile()
        With iniSettingsFile.SectionNoNull("TrackInfo")
          Return ParseColors(.StringValue("StatusStripTextColor"))
        End With
      End If
      Return c.Value
    End Get
  End Property

  Public ReadOnly Property TrackInfoLongPressIndicatorColor() As Color
    Get
      Static c As Color? = Nothing
      If c Is Nothing Then
        If iniSettingsFile Is Nothing Then ReloadSkinINIFile()
        With iniSettingsFile.SectionNoNull("TrackInfo")
          Return ParseColors(.StringValue("LongPressIndicatorColor"))
        End With
      End If
      Return c.Value
    End Get
  End Property

  Public ReadOnly Property ControlsBackgroundColor() As Color
    Get
      Static c As Color? = Nothing
      If c Is Nothing Then
        If iniSettingsFile Is Nothing Then ReloadSkinINIFile()
        With iniSettingsFile.SectionNoNull("Controls")
          Return ParseColors(.StringValue("BackgroundColor"))
        End With
      End If
      Return c.Value
    End Get
  End Property

  Public ReadOnly Property ControlsSectionSplashTextColor() As Color
    Get
      Static c As Color? = Nothing
      If c Is Nothing Then
        If iniSettingsFile Is Nothing Then ReloadSkinINIFile()
        With iniSettingsFile.SectionNoNull("Controls")
          Return ParseColors(.StringValue("SectionSplashTextColor"))
        End With
      End If
      Return c.Value
    End Get
  End Property

  Public ReadOnly Property ControlsOverlayTextColor() As Color
    Get
      Static c As Color? = Nothing
      If c Is Nothing Then
        If iniSettingsFile Is Nothing Then ReloadSkinINIFile()
        With iniSettingsFile.SectionNoNull("Controls")
          Return ParseColors(.StringValue("OverlayTextColor"))
        End With
      End If
      Return c.Value
    End Get
  End Property

  Public ReadOnly Property VolumeBackgroundColor() As Color
    Get
      Static c As Color? = Nothing
      If c Is Nothing Then
        If iniSettingsFile Is Nothing Then ReloadSkinINIFile()
        With iniSettingsFile.SectionNoNull("Volume")
          Return ParseColors(.StringValue("BackgroundColor"))
        End With
      End If
      Return c.Value
    End Get
  End Property

  Public ReadOnly Property OverlayBackgroundColor() As Color
    Get
      Static c As Color? = Nothing
      If c Is Nothing Then
        If iniSettingsFile Is Nothing Then ReloadSkinINIFile()
        With iniSettingsFile.SectionNoNull("Library")
          Return ParseColors(.StringValue("OverlayBackgroundColor"))
        End With
      End If
      Return c.Value
    End Get
  End Property

  Public ReadOnly Property OverlayTextColor() As Color
    Get
      Static c As Color? = Nothing
      If c Is Nothing Then
        If iniSettingsFile Is Nothing Then ReloadSkinINIFile()
        With iniSettingsFile.SectionNoNull("Library")
          Return ParseColors(.StringValue("OverlayTextColor"))
        End With
      End If
      Return c.Value
    End Get
  End Property

  Public ReadOnly Property NoMatchBackgroundColor() As Color
    Get
      Static c As Color? = Nothing
      If c Is Nothing Then
        If iniSettingsFile Is Nothing Then ReloadSkinINIFile()
        With iniSettingsFile.SectionNoNull("Library")
          Return ParseColors(.StringValue("NoMatchBackgroundColor"))
        End With
      End If
      Return c.Value
    End Get
  End Property

  Public ReadOnly Property NoMatchTextColor() As Color
    Get
      Static c As Color? = Nothing
      If c Is Nothing Then
        If iniSettingsFile Is Nothing Then ReloadSkinINIFile()
        With iniSettingsFile.SectionNoNull("Library")
          Return ParseColors(.StringValue("NoMatchTextColor"))
        End With
      End If
      Return c.Value
    End Get
  End Property

#End Region

End Module
